package com.autologistics.action;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.security.auth.message.callback.PrivateKeyCallback.Request;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.struts2.ServletActionContext;
import org.aspectj.weaver.NewMethodTypeMunger;

import com.autologistics.model.Disparter;
import com.autologistics.model.Goods;
import com.autologistics.model.Goods1;
import com.autologistics.model.GoodsCount;
import com.autologistics.model.Goodskind;
import com.autologistics.model.Goodskinds1;
import com.autologistics.model.Goodsorder;
import com.autologistics.model.GoodsorderId;
import com.autologistics.model.Machine;
import com.autologistics.model.Machineaddress;
import com.autologistics.model.Machineaddress1;
import com.autologistics.model.Ordertable;
import com.autologistics.model.OrdertableImage;
import com.autologistics.model.User;
import com.autologistics.model.User1;
import com.autologistics.service.DisparterService;
import com.autologistics.service.FororderidService;
import com.autologistics.service.GoodsService;
import com.autologistics.service.GoodskindService;
import com.autologistics.service.GoodsorderService;
import com.autologistics.service.MachineService;
import com.autologistics.service.MachineaddressService;
import com.autologistics.service.OrdertableService;
import com.autologistics.service.UserService;
import com.autologistics.util.GobalValue;
import com.autologistics.util.MatrixToImageWriter;
import com.autologistics.util.MyApplet;
import com.autologistics.util.PageBean;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.sun.mail.iap.Response;

public class OrdertableAction extends ActionSupport implements
		ModelDriven<Ordertable> {
	DisparterService disparterService;
	UserService userService;
	MachineService machineService;
	GoodsService goodsService;
	OrdertableService ordertableService;
	MachineaddressService machineaddressService;
	GoodsorderService goodsorderService;
	FororderidService fororderidService;
	GoodskindService goodskindService;
	List<Ordertable> listordertable;
	List<User> listuser;
	List<Disparter> listdisparter;
	List<GoodsCount> listgoodcount = new ArrayList<GoodsCount>();
	private String message = null;
	private Ordertable ordertable = new Ordertable();
	private int uid;
	private int mid;
	private int kid;
	private int userId;
	private String receivePhone;
	private String receiverName;
	private String receiverAddress;
	private int goodsId;
	private int disparterId;
	private int address1;
	private int address2;
	private String heatselect;
	private String username;
	private String goodsname;
	private String path;
	private int renId;
	private int renrole;
	private String renname;
	private String searchtext;
	private String searchtext1;
	private int searchkind;
	private PageBean pageBean;
	// 默认是1
	private int page = 1;
	HttpServletResponse response = ServletActionContext.getResponse();

	// -----------------------------------------------admin----------------------------
	/**
	 * 列出所有订单
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String listAllOrdertable() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		listordertable = ordertableService.listAll();
		if (listordertable == null) {
			message = "暂无订单";
			return SUCCESS;
		}
		this.pageBean = ordertableService.queryForOnePage(GobalValue.pageSize,
				page, ordertableService.listAll().size());
		listordertable = pageBean.getOrdertableList();
		for (Ordertable o : listordertable) {
			o.setDisparter(disparterService.getById(o.getDisparter().getId()));
			Machine m = machineService.getById(o.getMachine().getId());
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			o.setMachine(m);
		}
		return SUCCESS;
	}

	/**
	 * 准备添加订单
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String preAddOrdertable() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		listuser = userService.listAll();
		if (listuser == null) {
			message = "暂无用户请先添加";
			return ERROR;
		}
		listdisparter = disparterService.listByState(1);
		if (listdisparter == null) {
			message = "暂无配送员请先添加";
			return ERROR;
		}
		return SUCCESS;
	}

	/**
	 * 确认添加订单
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String checkOrdertable() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		listdisparter = disparterService.listAll();
		ordertable.setOrderId(fororderidService.getNewOrderId());
		ordertable.setReceiverPhone(receivePhone);
		// ordertable.setReceiverName(receiverName);
		// ordertable.setReceiverAddress(receiverAddress);
		username = userService.getById(userId).getName();
		goodsname = goodsService.getGoodById(goodsId).getName();
		ordertable.setDisparter(disparterService.getById(disparterId));
		Machine m = machineService.getByAddressId(address2);
		m.setMachineaddress(machineaddressService.getById(address2));
		ordertable.setMachine(m);
		if (heatselect.equals("1")) {
			ordertable.setHeat(true);
		} else {
			ordertable.setHeat(false);
		}
		message = "ok";
		return SUCCESS;
	}

	/**
	 * 添加订单
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String addOrdertable() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		Timestamp ts = new Timestamp(new Date().getTime());
		ordertable.setTime(ts);
		Goods g = goodsService.getGoodById(goodsId);
		Machine m = machineService.getById(ordertable.getMachine().getId());
		Machineaddress ma = machineaddressService.getById(ordertable
				.getMachine().getMachineaddress().getId());
		ma.setMachineaddress(machineaddressService.getById(ma
				.getMachineaddress().getId()));
		m.setMachineaddress(ma);
		ordertable.setMachine(m);
		ordertable.setState(1);
		//生成二维码
		OrdertableImage oti = new OrdertableImage(ordertable.getOrderId(),
				g.getName(), ordertable.getReceiverPhone(),
				ordertable.getReceiverName(), ordertable.getReceiverAddress(),
				ma.getMachineaddress().getName(), ma.getName(),
				ordertable.getHeat());
		JSONObject json = new JSONObject().fromObject(oti);
		ActionContext ac = ActionContext.getContext();
		ServletContext sc = (ServletContext) ac
				.get(ServletActionContext.SERVLET_CONTEXT);
		String temp = ServletActionContext.getRequest().getRealPath("/");
		String filePath = temp + "images";
		filePath = filePath.replaceAll("/", "\\\\");
		try {
			MatrixToImageWriter.getImage(json.toString(), filePath, "/"
					+ ordertable.getOrderId() + ".jpg");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		path = "/images/" + ordertable.getOrderId() + ".jpg";
		int orderId = ordertableService.save(ordertable);
		ordertable.setId(orderId);
		GoodsorderId goi = new GoodsorderId(g, ordertable, 1);
		goodsorderService.save(goi);
		return SUCCESS;
	}

	/**
	 * 订单详情
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String preDetailOrdertable() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		ordertable = ordertableService.getById(ordertable.getId());
		// disparter
		ordertable.setDisparter(disparterService.getById(ordertable
				.getDisparter().getId()));
		// machine
		Machine m = machineService.getById(ordertable.getMachine().getId());
		Machineaddress ma = machineaddressService.getById(m.getMachineaddress()
				.getId());
		ma.setMachineaddress(machineaddressService.getById(ma
				.getMachineaddress().getId()));
		m.setMachineaddress(ma);
		ordertable.setMachine(m);
		// goods
		GoodsorderId goi = goodsorderService.getGoodsorderByOrderId(ordertable
				.getId());
		Goods g = goodsService.getGoodById(goi.getGoods().getId());
		goodsname = g.getName();
		// user
		User u = userService.getById(g.getUser().getId());
		username = u.getName();

		return SUCCESS;
	}

	/**
	 * 订单作废
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String cancelOrder() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		ordertable = ordertableService.getById(ordertable.getId());
		ordertable.setState(4);
		ordertableService.updata(ordertable);
		return this.listAllOrdertable();
	}

	/**
	 * 获得二维码
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String getImage() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		ordertable = ordertableService.getById(ordertable.getId());
		GoodsorderId goi = goodsorderService.getGoodsorderByOrderId(ordertable
				.getId());
		Goods g = goodsService.getGoodById(goi.getGoods().getId());
		Machine m = machineService.getById(ordertable.getMachine().getId());
		Machineaddress ma = machineaddressService.getById(m.getMachineaddress()
				.getId());
		ma.setMachineaddress(machineaddressService.getById(ma
				.getMachineaddress().getId()));
		m.setMachineaddress(ma);
		ordertable.setMachine(m);
		OrdertableImage oti = new OrdertableImage(ordertable.getOrderId(),
				g.getName(), ordertable.getReceiverPhone(),
				ordertable.getReceiverName(), ordertable.getReceiverAddress(),
				ma.getMachineaddress().getName(), ma.getName(),
				ordertable.getHeat());
		JSONObject json = new JSONObject().fromObject(oti);
		ActionContext ac = ActionContext.getContext();
		ServletContext sc = (ServletContext) ac
				.get(ServletActionContext.SERVLET_CONTEXT);
		String temp = ServletActionContext.getRequest().getRealPath("/");
		String filePath = temp + "images";
		filePath = filePath.replaceAll("/", "\\\\");
		try {
			MatrixToImageWriter.getImage(json.toString(), filePath, "/"
					+ ordertable.getOrderId() + ".jpg");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		path = "/images/" + ordertable.getOrderId() + ".jpg";
		return SUCCESS;
	}

	// -----------------------------------------------user----------------------------
	/**
	 * 列出所有用户订单
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String listAllOrdertableUser() {
		if (!checkLogin()) {
			return "loginfail";
		}
		listordertable = ordertableService.listAllByUser(renId);
		if (listordertable == null) {
			message = "暂无订单";
			return SUCCESS;
		}
		pageBean = ordertableService.queryForOnePageUser(GobalValue.pageSize,
				page, listordertable.size(), renId);
		listordertable = pageBean.getOrdertableList();
		for (Ordertable o : listordertable) {
			o.setDisparter(disparterService.getById(o.getDisparter().getId()));
			Machine m = machineService.getById(o.getMachine().getId());
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			o.setMachine(m);
		}
		return SUCCESS;
	}

	/**
	 * 准备添加订单
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String preAddOrdertableUser() {
		if (!checkLogin()) {
			return "loginfail";
		}
		listdisparter = disparterService.listByState(1);
		if (listdisparter == null) {
			message = "暂无派送员，等待管理员添加";
			return ERROR;
		}
		userId = renId;
		return SUCCESS;
	}

	// -----------------------------------------------serach--------------------------
	/**
	 * 订单查找功能（检索分类）
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String searchKind() {
		if (searchtext == null) {
			try {
				searchtext1 = new String(searchtext1.getBytes("ISO-8859-1"),
						"UTF-8");
			} catch (UnsupportedEncodingException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			searchtext = searchtext1;
		}

		if (searchkind == 1) {
			return this.searchOrdertableId();
		} else if (searchkind == 2) {
			return this.searchDisparter();
		} else if (searchkind == 3) {
			return this.searchState();
		} else if (searchkind == 4) {
			return this.searchtime();
		}
		return SUCCESS;
	}

	/**
	 * 通过订单Id查找
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String searchOrdertableId() {
		if (ActionContext.getContext().getSession().get("role") != null) {
			if (!checkLogin()) {
				return "loginfail";
			}
			if (renrole != 0 && renrole != 3) {
				return "wrongrole";
			}
			pageBean = ordertableService.searchOrdertableId(
					GobalValue.pageSize, page, searchtext);
		} else {
			if (!checkLogin()) {
				return "loginfail";
			}
			pageBean = ordertableService.searchOrdertableIdUser(
					GobalValue.pageSize, page, searchtext, renId);
		}
		listordertable = pageBean.getOrdertableList();
		if (listordertable.isEmpty()) {
			message = "该搜索无结果";
			return SUCCESS;
		}
		for (Ordertable o : listordertable) {
			o.setDisparter(disparterService.getById(o.getDisparter().getId()));
			Machine m = machineService.getById(o.getMachine().getId());
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			o.setMachine(m);
		}
		return SUCCESS;
	}

	/**
	 * 通过配送员名字查找
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String searchDisparter() {
		if (ActionContext.getContext().getSession().get("role") != null) {
			if (!checkLogin()) {
				return "loginfail";
			}
			if (renrole != 0 && renrole != 3) {
				return "wrongrole";
			}
			pageBean = ordertableService.searchDisparter(GobalValue.pageSize,
					page, searchtext);
		} else {
			if (!checkLogin()) {
				return "loginfail";
			}
			pageBean = ordertableService.searchDisparterUser(
					GobalValue.pageSize, page, searchtext, renId);
		}
		listordertable = pageBean.getOrdertableList();
		if (listordertable.isEmpty()) {
			message = "该搜索无结果";
			return SUCCESS;
		}
		for (Ordertable o : listordertable) {
			o.setDisparter(disparterService.getById(o.getDisparter().getId()));
			Machine m = machineService.getById(o.getMachine().getId());
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			o.setMachine(m);
		}
		return SUCCESS;
	}

	/**
	 * 通过订单状态查找
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String searchState() {
		if (ActionContext.getContext().getSession().get("role") != null) {
			if (!checkLogin()) {
				return "loginfail";
			}
			if (renrole != 0 && renrole != 3) {
				return "wrongrole";
			}
			pageBean = ordertableService.searchState(GobalValue.pageSize, page,
					searchtext);
		} else {
			if (!checkLogin()) {
				return "loginfail";
			}
			pageBean = ordertableService.searchStateUser(GobalValue.pageSize,
					page, searchtext, renId);
		}
		listordertable = pageBean.getOrdertableList();
		if (listordertable.isEmpty()) {
			message = "该搜索无结果";
			return SUCCESS;
		}
		for (Ordertable o : listordertable) {
			o.setDisparter(disparterService.getById(o.getDisparter().getId()));
			Machine m = machineService.getById(o.getMachine().getId());
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			o.setMachine(m);
		}
		return SUCCESS;
	}

	/**
	 * 通过区间时间查找
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String searchtime() {
		String a[] = searchtext.split(",");
		Timestamp time1 = new Timestamp(new Date(a[0]).getTime());
		Timestamp time2 = new Timestamp(new Date(a[1]).getTime());
		if (ActionContext.getContext().getSession().get("role") != null) {
			if (!checkLogin()) {
				return "loginfail";
			}
			if (renrole != 0 && renrole != 3) {
				return "wrongrole";
			}
			pageBean = ordertableService.searchTime(GobalValue.pageSize, page,
					time1, time2);
		} else {
			if (!checkLogin()) {
				return "loginfail";
			}
			pageBean = ordertableService.searchTimeUser(GobalValue.pageSize,
					page, time1, time2, renId);
		}
		listordertable = pageBean.getOrdertableList();
		if (listordertable.isEmpty()) {
			message = "该搜索无结果";
			return SUCCESS;
		}
		for (Ordertable o : listordertable) {
			o.setDisparter(disparterService.getById(o.getDisparter().getId()));
			Machine m = machineService.getById(o.getMachine().getId());
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			o.setMachine(m);
		}
		return SUCCESS;
	}

	// -----------------------------------------------count---------------------------
	/**
	 * 统计模块
	 * @author lsyhyp@126.com
	 * @return
	 */
	public String listCount() {
		if (!checkLogin()) {
			return "loginfail";
		}
		if (renrole != 0 && renrole != 3) {
			return "wrongrole";
		}
		pageBean = ordertableService.GoodsCount(GobalValue.pageSize, page);
		List<Goods> glist = pageBean.getGoodsList();
		if (glist == null) {
			message = "暂无销量";
			return SUCCESS;
		}
		for (Goods g : glist) {
			g.setUser(userService.getById(g.getUser().getId()));
			int count = goodsorderService.getGoodsorderByGoodsId(g.getId())
					.size();
			GoodsCount gc = new GoodsCount(g.getId(), g.getName(), g.getUser()
					.getName(), count);
			listgoodcount.add(gc);
		}
		return SUCCESS;
	}

	// -----------------------------------------------other---------------------------
	public void showImage() {

		String filePath = this.getClass().getResource("/").getPath().toString()
				+ "images";
		filePath = filePath.replaceAll("/", "\\\\") + "\\";

		path = filePath;
		response.setContentType("text/html;charset=UTF-8");
		try {
			response.getWriter().print(path);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public String getPrint() {
		new MyApplet().init();
		new MyApplet().start();
		return SUCCESS;
	}

	public boolean checkLogin() {
		Map<String, Object> attibutes = ActionContext.getContext().getSession();
		if (attibutes.get("id") == null) {
			message = "未登陆，请重新登陆";
			return false;
		}
		String s = attibutes.get("id").toString();
		renId = Integer.parseInt(s);
		if (attibutes.get("role") != null) {
			s = attibutes.get("role").toString();
			renrole = Integer.parseInt(s);
		}
		renname = attibutes.get("name").toString();
		return true;
	}

	// ��ȡ�û�
	public String getUser() {
		List<User> provinceList = userService.listAll();
		JSONArray jsonArray = null;
		List<User1> userList1 = new ArrayList<User1>();
		for (User u : provinceList) {
			userList1.add(new User1(u.getId(), u.getName()));
		}
		try {
			jsonArray = JSONArray.fromObject(userList1);
		} catch (Exception e) {
			// TODO: handle exception
		}
		response.setContentType("text/html;charset=UTF-8");
		try {
			response.getWriter().print(jsonArray.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public String getKind() {
		List<Goodskind> kindList = goodskindService.listAll();
		JSONArray jsonArray = null;
		List<Goodskinds1> kindList1 = new ArrayList<Goodskinds1>();
		for (Goodskind k : kindList) {
			kindList1.add(new Goodskinds1(k.getId(), k.getName()));
		}
		try {
			jsonArray = JSONArray.fromObject(kindList1);
		} catch (Exception e) {
			// TODO: handle exception
		}
		response.setContentType("text/html;charset=UTF-8");
		try {
			response.getWriter().print(jsonArray.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public String getGoods() {
		if (uid == 0) {
			response.setContentType("text/html;charset=UTF-8");
			try {
				response.getWriter().print("needuser");
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}
		if (kid == 0) {
			response.setContentType("text/html;charset=UTF-8");
			try {
				response.getWriter().print("needkind");
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}
		List<Goods> goodsList = goodsService.getGoodsByUserAndKind(uid, kid);
		JSONArray jsonArray = null;
		if (goodsList == null) {
			response.setContentType("text/html;charset=UTF-8");
			try {
				response.getWriter().print(jsonArray);
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}
		List<Goods1> goodsList1 = new ArrayList<Goods1>();
		for (Goods g : goodsList) {
			goodsList1.add(new Goods1(g.getId(), g.getName(), g.getUser()
					.getId()));
		}
		try {
			jsonArray = JSONArray.fromObject(goodsList1);
		} catch (Exception e) {
			// TODO: handle exception
		}

		response.setContentType("text/html;charset=UTF-8");
		try {
			response.getWriter().print(jsonArray.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public String getMachineAddressFirst() {
		List<Machineaddress> machineAddressList = machineaddressService
				.getByParent(0);
		JSONArray jsonArray = null;
		List<Machineaddress1> machineaddressList1 = new ArrayList<Machineaddress1>();
		for (Machineaddress m : machineAddressList) {
			machineaddressList1.add(new Machineaddress1(m.getId(), m.getName(),
					0));
		}
		try {
			jsonArray = JSONArray.fromObject(machineaddressList1);
		} catch (Exception e) {
			// TODO: handle exception
		}
		response.setContentType("text/html;charset=UTF-8");
		try {
			response.getWriter().print(jsonArray.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public String getMachineAddressSecond() {
		List<Machine> machineList = machineService.listByState(1);
		List<Machineaddress> machineAddressList = new ArrayList<Machineaddress>();
		if (machineList==null) {
			response.setContentType("text/html;charset=UTF-8");
			try {
				response.getWriter().print("null");
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}
		for (Machine m : machineList) {
			m.setMachineaddress(machineaddressService.getById(m
					.getMachineaddress().getId()));
			if (m.getMachineaddress().getMachineaddress().getId() == mid) {
				machineAddressList.add(m.getMachineaddress());
			}
		}
		if (machineAddressList.isEmpty()) {
			response.setContentType("text/html;charset=UTF-8");
			try {
				response.getWriter().print("null");
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}
		JSONArray jsonArray = null;
		List<Machineaddress1> machineaddressList1 = new ArrayList<Machineaddress1>();
		for (Machineaddress m : machineAddressList) {
			machineaddressList1.add(new Machineaddress1(m.getId(), m.getName(),
					m.getMachineaddress().getId()));
		}
		try {
			jsonArray = JSONArray.fromObject(machineaddressList1);
		} catch (Exception e) {
			// TODO: handle exception
		}
		response.setContentType("text/html;charset=UTF-8");
		try {
			response.getWriter().print(jsonArray.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public Ordertable getModel() {
		// TODO Auto-generated method stub
		return this.ordertable;
	}

	// ------------------
	public String getSearchtext1() {
		return searchtext1;
	}

	public void setSearchtext1(String searchtext1) {
		this.searchtext1 = searchtext1;
	}

	public List<GoodsCount> getListgoodcount() {
		return listgoodcount;
	}

	public void setListgoodcount(List<GoodsCount> listgoodcount) {
		this.listgoodcount = listgoodcount;
	}

	public int getSearchkind() {
		return searchkind;
	}

	public void setSearchkind(int searchkind) {
		this.searchkind = searchkind;
	}

	public String getSearchtext() {
		return searchtext;
	}

	public void setSearchtext(String searchtext) {
		this.searchtext = searchtext;
	}

	public int getKid() {
		return kid;
	}

	public void setKid(int kid) {
		this.kid = kid;
	}

	public GoodskindService getGoodskindService() {
		return goodskindService;
	}

	public void setGoodskindService(GoodskindService goodskindService) {
		this.goodskindService = goodskindService;
	}

	public String getReceiverName() {
		return receiverName;
	}

	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	public String getReceiverAddress() {
		return receiverAddress;
	}

	public void setReceiverAddress(String receiverAddress) {
		this.receiverAddress = receiverAddress;
	}

	public FororderidService getFororderidService() {
		return fororderidService;
	}

	public void setFororderidService(FororderidService fororderidService) {
		this.fororderidService = fororderidService;
	}

	public PageBean getPageBean() {
		return pageBean;
	}

	public void setPageBean(PageBean pageBean) {
		this.pageBean = pageBean;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRenId() {
		return renId;
	}

	public void setRenId(int renId) {
		this.renId = renId;
	}

	public int getRenrole() {
		return renrole;
	}

	public void setRenrole(int renrole) {
		this.renrole = renrole;
	}

	public String getRenname() {
		return renname;
	}

	public void setRenname(String renname) {
		this.renname = renname;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public GoodsorderService getGoodsorderService() {
		return goodsorderService;
	}

	public void setGoodsorderService(GoodsorderService goodsorderService) {
		this.goodsorderService = goodsorderService;
	}

	public String getGoodsname() {
		return goodsname;
	}

	public void setGoodsname(String goodsname) {
		this.goodsname = goodsname;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getHeatselect() {
		return heatselect;
	}

	public void setHeatselect(String heatselect) {
		this.heatselect = heatselect;
	}

	public Ordertable getOrdertable() {
		return ordertable;
	}

	public void setOrdertable(Ordertable ordertable) {
		this.ordertable = ordertable;
	}

	public String getReceivePhone() {
		return receivePhone;
	}

	public void setReceivePhone(String receivePhone) {
		this.receivePhone = receivePhone;
	}

	public int getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(int goodsId) {
		this.goodsId = goodsId;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getDisparterId() {
		return disparterId;
	}

	public void setDisparterId(int disparterId) {
		this.disparterId = disparterId;
	}

	public int getAddress1() {
		return address1;
	}

	public void setAddress1(int address1) {
		this.address1 = address1;
	}

	public int getAddress2() {
		return address2;
	}

	public void setAddress2(int address2) {
		this.address2 = address2;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public int getMid() {
		return mid;
	}

	public void setMid(int mid) {
		this.mid = mid;
	}

	public MachineaddressService getMachineaddressService() {
		return machineaddressService;
	}

	public void setMachineaddressService(
			MachineaddressService machineaddressService) {
		this.machineaddressService = machineaddressService;
	}

	public List<Disparter> getListdisparter() {
		return listdisparter;
	}

	public void setListdisparter(List<Disparter> listdisparter) {
		this.listdisparter = listdisparter;
	}

	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}

	public GoodsService getGoodsService() {
		return goodsService;
	}

	public void setGoodsService(GoodsService goodsService) {
		this.goodsService = goodsService;
	}

	public List<User> getListuser() {
		return listuser;
	}

	public void setListuser(List<User> listuser) {
		this.listuser = listuser;
	}

	public HttpServletResponse getResponse() {
		return response;
	}

	public void setResponse(HttpServletResponse response) {
		this.response = response;
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public DisparterService getDisparterService() {
		return disparterService;
	}

	public void setDisparterService(DisparterService disparterService) {
		this.disparterService = disparterService;
	}

	public MachineService getMachineService() {
		return machineService;
	}

	public void setMachineService(MachineService machineService) {
		this.machineService = machineService;
	}

	public List<Ordertable> getListordertable() {
		return listordertable;
	}

	public void setListordertable(List<Ordertable> listordertable) {
		this.listordertable = listordertable;
	}

	public OrdertableService getOrdertableService() {
		return ordertableService;
	}

	public void setOrdertableService(OrdertableService ordertableService) {
		this.ordertableService = ordertableService;
	}
}
